package org.openwork.portlet.skillmanagement.service;

import com.liferay.portal.kernel.util.ClassLoaderProxy;
import com.liferay.portal.kernel.util.LongWrapper;
import com.liferay.portal.kernel.util.NullWrapper;


public class SkillCategoryServiceClp implements SkillCategoryService {
    private ClassLoaderProxy _classLoaderProxy;

    public SkillCategoryServiceClp(ClassLoaderProxy classLoaderProxy) {
        _classLoaderProxy = classLoaderProxy;
    }

    public org.openwork.portlet.skillmanagement.model.SkillCategory addSkillCategory(
        java.lang.String name, long userId, long groupId)
        throws com.liferay.portal.kernel.exception.PortalException,
            com.liferay.portal.kernel.exception.SystemException {
        Object paramObj0 = ClpSerializer.translateInput(name);

        if (name == null) {
            paramObj0 = new NullWrapper("java.lang.String");
        }

        Object paramObj1 = new LongWrapper(userId);

        Object paramObj2 = new LongWrapper(groupId);

        Object returnObj = null;

        try {
            returnObj = _classLoaderProxy.invoke("addSkillCategory",
                    new Object[] { paramObj0, paramObj1, paramObj2 });
        } catch (Throwable t) {
            if (t instanceof com.liferay.portal.kernel.exception.PortalException) {
                throw (com.liferay.portal.kernel.exception.PortalException) t;
            }

            if (t instanceof com.liferay.portal.kernel.exception.SystemException) {
                throw (com.liferay.portal.kernel.exception.SystemException) t;
            }

            if (t instanceof RuntimeException) {
                throw (RuntimeException) t;
            } else {
                throw new RuntimeException(t.getClass().getName() +
                    " is not a valid exception");
            }
        }

        return (org.openwork.portlet.skillmanagement.model.SkillCategory) ClpSerializer.translateOutput(returnObj);
    }

    public org.openwork.portlet.skillmanagement.model.SkillCategory updateSkillCategory(
        long pk, java.lang.String name, long userId, long groupId)
        throws com.liferay.portal.kernel.exception.PortalException,
            com.liferay.portal.kernel.exception.SystemException {
        Object paramObj0 = new LongWrapper(pk);

        Object paramObj1 = ClpSerializer.translateInput(name);

        if (name == null) {
            paramObj1 = new NullWrapper("java.lang.String");
        }

        Object paramObj2 = new LongWrapper(userId);

        Object paramObj3 = new LongWrapper(groupId);

        Object returnObj = null;

        try {
            returnObj = _classLoaderProxy.invoke("updateSkillCategory",
                    new Object[] { paramObj0, paramObj1, paramObj2, paramObj3 });
        } catch (Throwable t) {
            if (t instanceof com.liferay.portal.kernel.exception.PortalException) {
                throw (com.liferay.portal.kernel.exception.PortalException) t;
            }

            if (t instanceof com.liferay.portal.kernel.exception.SystemException) {
                throw (com.liferay.portal.kernel.exception.SystemException) t;
            }

            if (t instanceof RuntimeException) {
                throw (RuntimeException) t;
            } else {
                throw new RuntimeException(t.getClass().getName() +
                    " is not a valid exception");
            }
        }

        return (org.openwork.portlet.skillmanagement.model.SkillCategory) ClpSerializer.translateOutput(returnObj);
    }

    public void deleteSkillCategory(long pk)
        throws com.liferay.portal.kernel.exception.PortalException,
            com.liferay.portal.kernel.exception.SystemException {
        Object paramObj0 = new LongWrapper(pk);

        try {
            _classLoaderProxy.invoke("deleteSkillCategory",
                new Object[] { paramObj0 });
        } catch (Throwable t) {
            if (t instanceof com.liferay.portal.kernel.exception.PortalException) {
                throw (com.liferay.portal.kernel.exception.PortalException) t;
            }

            if (t instanceof com.liferay.portal.kernel.exception.SystemException) {
                throw (com.liferay.portal.kernel.exception.SystemException) t;
            }

            if (t instanceof RuntimeException) {
                throw (RuntimeException) t;
            } else {
                throw new RuntimeException(t.getClass().getName() +
                    " is not a valid exception");
            }
        }
    }

    public java.util.List<org.openwork.portlet.skillmanagement.model.SkillCategory> search(
        long groupId)
        throws com.liferay.portal.kernel.exception.PortalException,
            com.liferay.portal.kernel.exception.SystemException {
        Object paramObj0 = new LongWrapper(groupId);

        Object returnObj = null;

        try {
            returnObj = _classLoaderProxy.invoke("search",
                    new Object[] { paramObj0 });
        } catch (Throwable t) {
            if (t instanceof com.liferay.portal.kernel.exception.PortalException) {
                throw (com.liferay.portal.kernel.exception.PortalException) t;
            }

            if (t instanceof com.liferay.portal.kernel.exception.SystemException) {
                throw (com.liferay.portal.kernel.exception.SystemException) t;
            }

            if (t instanceof RuntimeException) {
                throw (RuntimeException) t;
            } else {
                throw new RuntimeException(t.getClass().getName() +
                    " is not a valid exception");
            }
        }

        return (java.util.List<org.openwork.portlet.skillmanagement.model.SkillCategory>) ClpSerializer.translateOutput(returnObj);
    }

    public int searchCount(long groupId)
        throws com.liferay.portal.kernel.exception.PortalException,
            com.liferay.portal.kernel.exception.SystemException {
        Object paramObj0 = new LongWrapper(groupId);

        Object returnObj = null;

        try {
            returnObj = _classLoaderProxy.invoke("searchCount",
                    new Object[] { paramObj0 });
        } catch (Throwable t) {
            if (t instanceof com.liferay.portal.kernel.exception.PortalException) {
                throw (com.liferay.portal.kernel.exception.PortalException) t;
            }

            if (t instanceof com.liferay.portal.kernel.exception.SystemException) {
                throw (com.liferay.portal.kernel.exception.SystemException) t;
            }

            if (t instanceof RuntimeException) {
                throw (RuntimeException) t;
            } else {
                throw new RuntimeException(t.getClass().getName() +
                    " is not a valid exception");
            }
        }

        return ((Integer) returnObj).intValue();
    }

    public java.util.List<org.openwork.portlet.skillmanagement.model.SkillCategory> search(
        long[] groupId)
        throws com.liferay.portal.kernel.exception.PortalException,
            com.liferay.portal.kernel.exception.SystemException {
        Object paramObj0 = ClpSerializer.translateInput(groupId);

        if (groupId == null) {
            paramObj0 = new NullWrapper("[J");
        }

        Object returnObj = null;

        try {
            returnObj = _classLoaderProxy.invoke("search",
                    new Object[] { paramObj0 });
        } catch (Throwable t) {
            if (t instanceof com.liferay.portal.kernel.exception.PortalException) {
                throw (com.liferay.portal.kernel.exception.PortalException) t;
            }

            if (t instanceof com.liferay.portal.kernel.exception.SystemException) {
                throw (com.liferay.portal.kernel.exception.SystemException) t;
            }

            if (t instanceof RuntimeException) {
                throw (RuntimeException) t;
            } else {
                throw new RuntimeException(t.getClass().getName() +
                    " is not a valid exception");
            }
        }

        return (java.util.List<org.openwork.portlet.skillmanagement.model.SkillCategory>) ClpSerializer.translateOutput(returnObj);
    }

    public int searchCount(long[] groupId)
        throws com.liferay.portal.kernel.exception.PortalException,
            com.liferay.portal.kernel.exception.SystemException {
        Object paramObj0 = ClpSerializer.translateInput(groupId);

        if (groupId == null) {
            paramObj0 = new NullWrapper("[J");
        }

        Object returnObj = null;

        try {
            returnObj = _classLoaderProxy.invoke("searchCount",
                    new Object[] { paramObj0 });
        } catch (Throwable t) {
            if (t instanceof com.liferay.portal.kernel.exception.PortalException) {
                throw (com.liferay.portal.kernel.exception.PortalException) t;
            }

            if (t instanceof com.liferay.portal.kernel.exception.SystemException) {
                throw (com.liferay.portal.kernel.exception.SystemException) t;
            }

            if (t instanceof RuntimeException) {
                throw (RuntimeException) t;
            } else {
                throw new RuntimeException(t.getClass().getName() +
                    " is not a valid exception");
            }
        }

        return ((Integer) returnObj).intValue();
    }

    public ClassLoaderProxy getClassLoaderProxy() {
        return _classLoaderProxy;
    }
}
